<?php
$con = mysql_connect("localhost","root","数据库密码");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_query("SET NAMES 'utf8mb4'");
mysql_select_db("表名",$con); 
?>